diff options
| author | MohamedBassem <me@mbassem.com> | 2024-03-13 22:37:41 +0000 |
|---|---|---|
| committer | Mohamed Bassem <me@mbassem.com> | 2024-03-14 16:40:45 +0000 |
| commit | a03f1dc2ac25579df30e8cb59d2703110c3e564d (patch) | |
| tree | 59315e73cd83dc391660071c70752cf23989b3da /apps/web/app/api/trpc/[trpc] | |
| parent | 04572a8e5081b1e4871e273cde9dbaaa44c52fe0 (diff) | |
| download | karakeep-a03f1dc2ac25579df30e8cb59d2703110c3e564d.tar.zst | |
lint: Lint and format the entire repo with the new configs
Diffstat (limited to 'apps/web/app/api/trpc/[trpc]')
| -rw-r--r-- | apps/web/app/api/trpc/[trpc]/route.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/web/app/api/trpc/[trpc]/route.ts b/apps/web/app/api/trpc/[trpc]/route.ts index 02ca966d..23df286f 100644 --- a/apps/web/app/api/trpc/[trpc]/route.ts +++ b/apps/web/app/api/trpc/[trpc]/route.ts @@ -1,8 +1,9 @@ -import { fetchRequestHandler } from "@trpc/server/adapters/fetch"; -import { appRouter } from "@hoarder/trpc/routers/_app"; import { createContext } from "@/server/api/client"; -import { authenticateApiKey } from "@hoarder/trpc/auth"; +import { fetchRequestHandler } from "@trpc/server/adapters/fetch"; + import { db } from "@hoarder/db"; +import { authenticateApiKey } from "@hoarder/trpc/auth"; +import { appRouter } from "@hoarder/trpc/routers/_app"; const handler = (req: Request) => fetchRequestHandler({ @@ -21,7 +22,7 @@ const handler = (req: Request) => // Check if the request has an Authorization token, if it does, assume that API key authentication is requested. const authorizationHeader = opts.req.headers.get("Authorization"); if (authorizationHeader && authorizationHeader.startsWith("Bearer ")) { - const token = authorizationHeader.split(" ")[1]!; + const token = authorizationHeader.split(" ")[1]; try { const user = await authenticateApiKey(token); return { user, db }; |
